package com.zhang.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 学校实体类
 */
@Data
@ToString
@NoArgsConstructor
public class School {
    /**学校编号*/
    private int id;
    /**学校名称*/
    private String name;
    /**学校校长*/
    private String principal;
    /**学校加入时间*/
    private LocalDate startTime = LocalDate.now();
    /**学校电话*/
    private String phone;
    /**学校状态*/
    private String status = "接洽中";
    /**学校意见*/
    private String opinion = "无";
    /**学校所在城市*/
    private City city;

    public School(String name, String principal, String phone,int cityId) {
        this.name = name;
        this.principal = principal;
        this.phone = phone;
        this.city= new City();
        city.setId(cityId);
    }

    @Override
    public String toString() {
        return "School{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", principal='" + principal + '\'' +
                ", startTime=" + startTime +
                ", phone='" + phone + '\'' +
                ", status='" + status + '\'' +
                ", opinion='" + opinion + '\'' +
                ", city=" + city +
                '}'+"\n";
    }
}
